page title fix and javascript scrool effect fix retry

jamesperet 9 years ago
parent
commit
e0c6621e06
1 changed files with 11 additions and 1 deletions
  1. 11 1
      app/assets/javascripts/start.js

+ 11 - 1
app/assets/javascripts/start.js

@@ -2,7 +2,7 @@
2 2
 function attachHandler(jQuery) {
3 3
 	var mainbottom = $('#myCarousel').offset().top + ($('#myCarousel').height()*2)-10;
4 4
 	var about_bottom = $('#post').offset().top +  $('#post-image').height() - (screen.height - $('#post-image').height() + 152);
5
-	var post_bottom = $('.feature-post-text').offset().top +  $('.feature-post-text').height() - (screen.height - $('.feature-post-text').height() + 500);
5
+	var post_bottom = $('.feature-post-text').offset().top +  $('.feature-post-text').height() - (screen.height - $('.feature-post-text').height() + 232);
6 6
 
7 7
 	// on scroll, 
8 8
 	$(window).on('scroll',function(){
@@ -69,6 +69,16 @@ function attachHandler(jQuery) {
69 69
 	    }, 1000);
70 70
 	});
71 71
 	
72
+	window.setInterval(function(){
73
+		var mainbottom = $('#myCarousel').offset().top + ($('#myCarousel').height()*2)-10;
74
+		var about_bottom = $('#post').offset().top +  $('#post-image').height() - (screen.height - $('#post-image').height() + 152);
75
+		var post_bottom = $('.feature-post-text').offset().top +  $('.feature-post-text').height() - (screen.height - $('.feature-post-text').height() + 232);
76
+	}, 5000);
77
+	$( window ).resize(function(){
78
+		var mainbottom = $('#myCarousel').offset().top + ($('#myCarousel').height()*2)-10;
79
+		var about_bottom = $('#post').offset().top +  $('#post-image').height() - (screen.height - $('#post-image').height() + 152);
80
+		var post_bottom = $('.feature-post-text').offset().top +  $('.feature-post-text').height() - (screen.height - $('.feature-post-text').height() + 232);
81
+	});
72 82
 };
73 83
 
74 84
 $(document).ready(attachHandler);